//
// Created by Zhangwj on 2023/9/27.
//

#include "FuncRParamsNode.h"

std::unique_ptr<FuncRParamsNode> FuncRParamsNode::FuncRParamsParser(Parser &parser) {
    //FuncRParams → Exp { ',' Exp }
    std::unique_ptr<FuncRParamsNode> funcRParamsNode = std::make_unique<FuncRParamsNode>();
    funcRParamsNode->Exps.push_back(ExpNode::ExpParser(parser));
    while (parser.getLexType(0) == LexType::COMMA) {
        parser.next();
        funcRParamsNode->Exps.push_back(ExpNode::ExpParser(parser));
    }
    return funcRParamsNode;
}
